home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / UTILITIE / CONVERSI / H400.ZIP / ZSIM22.ZIP / ZSIM.DOC < prev    next >
Text File  |  1993-06-16  |  44KB  |  1,307 lines

  1.  
  2. **********************************************************************
  3. **********************************************************************
  4.  
  5.  
  6.  
  7.    ZZZZZZZZZZ                 SSSSSSSS      IIII    M         M
  8.           ZZ                 SS              II     MM       MM
  9.          ZZ                  SS              II     M M     M M
  10.         ZZ                     SS            II     M  M   M  M
  11.        ZZ       ---------         SS         II     M   M M   M
  12.       ZZ        ---------          SS        II     M    M    M
  13.      ZZ                           SS         II     M         M
  14.     ZZ                           SS          II     M         M
  15.   ZZZZZZZZZZZ                SSSS           IIII   MMM       MMM
  16.  
  17.  
  18.  
  19.              The hundred percent Z80 Emulator
  20.  
  21.              Version 2.2
  22.  
  23.              Copyright (C) 1990, 1993 by Jürgen Weber
  24.  
  25.              Jürgen Weber
  26.              Wiesentalstr. 1
  27.              D-74523 Schwäbisch Hall
  28.              Federal Republic of Germany
  29.  
  30.              email: weberj@dia.informatik.uni-stuttgart.de
  31.  
  32. **********************************************************************
  33. **********************************************************************
  34.  
  35. IMPORTANT:
  36.  
  37. The author assumes no responsibility for the correctness of the
  38. documentation or the function of the program. The user is advised to
  39. test the program fully. The risk of using the software is exclusively
  40. at the user. The author assumes no responsibility whatever for damages
  41. of any kind that might result from using the program.
  42.  
  43. Cited product names are trade names.
  44.  
  45. Minimal Hardware/Software preconditions:
  46.  
  47. AT 286, hard disk, 1 Disk-drive (5 1/4 inch recommended),
  48. 256K free memory, MsDos 2.1 or compatible.
  49.  
  50. ZSIM does work within the OS/2 2.x dos emulation, but every few
  51. seconds the OS tries to log in the (CP/M) disk. So you should dispense
  52. with disks within VDM and use the /N /A parameters.
  53.  
  54.  
  55. Serious work is only possible with machines faster than 8 MHz 80286.
  56. Every 10 MHz shown by the Landmark test correspond to 1 MHz of the
  57. emulated Z80.
  58.  
  59.  
  60.  
  61. IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
  62. *********************************************************************
  63. IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
  64.  
  65. Be sure that you do not insert a MS-Dos disc when prompted for a CP/M
  66. disc. The CP/M bios would overwrite the MS-Dos disc without prompting.
  67. Also MS-Dos overwrites CP/M discs.
  68.  
  69. As soon as the emulator prompts for inserting a CP/M disc only use
  70. CP/M discs.
  71. Be sure that the CP/M disc has the right format. Insert the disc WRITE
  72. PROTECTED and enter DIR to display the directory. If only dots are
  73. displayed it is a clue for a wrong format. But also if "NO FILE" is
  74. displayed it might be a wrong format except if you are sure that the
  75. disc is indeed empty.
  76.  
  77.  
  78.  
  79.  
  80. CONTENTS:
  81.  
  82. I    GENERAL
  83. II   EMULATOR
  84. III  DISK FORMATS
  85. IV   SCREEN DRIVER
  86. V    PRINTER
  87. VI   ENDING THE EMULATION
  88. VII  CONTROL BREAK MENÜ
  89. VIII DISC PARAMETERS
  90. IX   EMULATION OF THE Z80
  91. X    BENCHMARKS
  92.  
  93. Appendix 1: Screen control sequences
  94. Appendix 2: Description of the bios functions
  95. Appendix 3: undocumented Z80 Op-Codes
  96. Appendix 4: A test for the emulation
  97. Appendix 5: How to use interrupts
  98. Appendix 6: The DOSFTP utility
  99. Appendix 7: An example for IOBYTE usage
  100.  
  101.  
  102.  
  103. INSTALLATION:
  104. =============
  105.  
  106. Copy the files in the package into a directory of your hard disk.
  107.  
  108. I GENERAL:
  109. ===========
  110.  
  111. ZSIM emulates a Z80 CP/M Machine (CP/M 2.2), but not the CP/M
  112. operating system itself. In order to start CP/M, a CP/M System disc
  113. must be inserted into drive A:, where from ZSIM boots CP/M. (You can
  114. also use you dos drive B: using ZSIM option /D1) The CP/M system or a
  115. compatible operating system (SUPERDOS and Z80DOS are included in the
  116. ZSIM package) also can be put into a file CPMSYS.CPM on the hard disk.
  117. Then you don't need a boot disc.
  118.  
  119. Every CP/M program I could test ran correctly, even the floating point
  120. library of the public domain program SMALL-C, that requires a high
  121. compatibility, as it uses undocumented Z80 codes.
  122. The complete compatibility to a CP/M machine is reached because
  123. contrary to other emulators that emulate the operating system itself
  124. ZSIM only emulates the Z80 and the bios. On this virtual machine runs
  125. the original CP/M or a CP/M compatible operating system.
  126.  
  127.  
  128.  
  129. II) EMULATOR:
  130. =============
  131.  
  132. In the following only the specialties of the virtual CP/M machine are
  133. described. For information concerning the CP/M operating system please
  134. consult literature covering this subject, for example D.E.Cortesi:
  135. INSIDE CP/M.
  136.  
  137. Enter ZSIM /H to get a list of its options.
  138.  
  139. ZSIM creates a CP/M machine with 64K ram, one disk drive and a
  140. ram disk. Additionally you can use a file on your dos hard disk
  141. as a CP/M hard disk.
  142.  
  143. There is only one physical CP/M drive supported. The physical drive
  144. can be set to IBM-PC drive 0 or 1 by changing the disc parameters in
  145. the control-Break menu or by using option /D.
  146. Per default the PC drive is CP/M drive A. But with Control Break menu
  147. option Swap Drives or ZSIM option /A you can set it to B: and the
  148. ram disk to A. The whole memory pool that is not required by Dos, ZSIM
  149. and the 64K working space for the Z80, is used as ram disk (440K
  150. ram disk in a 640K PC). You can restrain the size of the 1 using
  151. parameter /snnn. For example /s300 means use a maximum of 300
  152. kilobytes for the ram disk.
  153. The 1 can be saved in a MS-Dos File, that will be
  154. automatically loaded when starting ZSIM next time, but only if there
  155. is enough memory for the 1. So don't use more TSRs next time. Or
  156. always use parameter /S.
  157. You can keep important utilities in the ram disk and have them
  158. present every time you start ZSIM.
  159.  
  160. With ZSIM option /C you can create a file on your dos hard disk, that
  161. simulates a CP/M hard disk.
  162. This CP/M hard disk is always 8 Megabytes large. Initially the Msdos
  163. file contains only the directory records. This makes a file size of
  164. 32K. As you put more files onto it it grows up to its final size of
  165. 8M. This is possible because the Msdos file is read/written by random
  166. accesses. Msdos dynamically enlarges this file so that the largest
  167. accessed record is always in the file. Unfortunately it does not
  168. shrink even if you delete CP/M files. Note that if you do low level
  169. read accesses to records uninitialized yet you will get nonsense data!
  170. This hard disk file is kept until you delete it from within Msdos or
  171. until you create a new one with option /C.
  172. When you start with ZSIM /N /A you can work with hard disk and ram
  173. disk and you don't need a floppy disc in the drive (as long you don't
  174. access it).
  175.  
  176.  
  177.  
  178. STARTING:
  179.  
  180. While starting ZSIM tries to load CP/M Bdos from a MS-Dos file
  181. CPMSYS.CPM into memory. The file must be in the directory ZSIM was
  182. started in.
  183. The ZSIM package contains two CP/M compatible operating systems in the
  184. files SUPERDOS.SYS and Z80DOS.SYS. Both contain the ZCPR1 command line
  185. processor. Z80DOS is a derivative of SUPERDOS and supports date and
  186. time (ZSIM's bios furnishes time and date). But there may be write
  187. errors if you use discs that were already written to by the original
  188. CP/M system. This is because Z80DOS uses a slightly different, faster
  189. file system.
  190. Note: There seems to be a bug within SUPERDOS as SMALL-C vers. 2.1
  191. will not work with it. SMALL-C vers. 2.1 does work with the original
  192. CP/M and with Z80DOS. Until now SMALL-C 2.1 is the only program I
  193. found that does not work with SUPERDOS.
  194. To use one of the public domain operating systems simply copy
  195. SUPERDOS.SYS or Z80DOS.sys to CPMSYS.CPM:
  196.  
  197. COPY SUPERDOS.SYS CPMSYS.CPM
  198.  
  199. If you format a disc using the utility CPMFRM you can start CP/M
  200. programs, e.g. Small-C, without having the original CP/M operating
  201. system. Create as described above CPMSYS.CPM, insert a disc formatted
  202. by CPMFRM and start ZSIM.
  203.  
  204. If CPMSYS.CPM is not present, ZSIM tries to load the system from the
  205. boot tracks by scanning all sectors within the reserved tracks for the
  206. Copyright message of Digital Research. If it is found DR's copyright
  207. is displayed and the following sectors are loaded as system. A system
  208. disc is only required for boot up, afterwards the system is kept in
  209. memory.
  210.  
  211. Even if you would like to use the original CP/M a system disc is only
  212. necessary to start ZSIM. Afterwards the system is kept in memory.
  213. After successful boot from disc you can create with MOVCPM a file
  214. containing an image of the system (don't forget the blank between
  215. the * *) and transfer it to MsDos.
  216.  
  217. Example:
  218.  
  219.  
  220. jgw 64K cp/m 80 bios ver 2.0 --  11/18/92  (C) 1990,1992 by Jürgen G. Weber
  221.  
  222. BDOS: COPYRIGHT (C) 1979, DIGITAL RESEARCH
  223.  
  224. B>a:movcpm * *
  225.  
  226. CONSTRUCTING 64k CP/M vers 2.2
  227. READY FOR "SYSGEN" OR
  228. "SAVE 34 CPM64.COM"
  229. B>save 34 cpmsys.cpm
  230. B>dosftp
  231. Enter help for a command list.
  232. WARNING: DO NOT ACCESS your physical CP/M drive (MSDOS drive B:)
  233.         with the exec command.
  234. dosftp> put cpmsys.cpm
  235. dosftp> quit
  236. Bye.
  237. B>
  238.  
  239. You can specify behind MOVCPM a smaller number, too. This generates a
  240. smaller CP/M system and leaves Z80 memory behind CP/M TPA and the
  241. system area. ZSIM automatically loads the smaller CP/M to the right
  242. place.
  243. The public domain operating systems SUPERDOS and Z80DOS are always
  244. loaded by ZSIM in a way that bdos is situated at 0ec00h.
  245.  
  246.  
  247.  
  248. III DISK FORMATS:
  249. =================
  250.  
  251. Following CP/M disk formats are supported:
  252.  
  253.    Amstrad CPC System  (169K, phys. Sectors 41h-49h)
  254.    Amstrad CPC Data    (178K, pays. Sectors 0c1h-0c9h)
  255.    CP/M 86 SS DD  (153K)
  256.    CP/M 86 DS DD  (316K)
  257.  
  258.    and additionally a special format corresponding to CPC data format
  259.    but with physical sector numbers starting at 1.
  260.  
  261. The Amstrad is a Z80 Home-computer that was quite popular in Europe in
  262. the middle of the eighties. For some months there has been an
  263. emulation for it, too.
  264.  
  265. The first two formats are special formats of the Amstrad CPC. The high
  266. nibble of the sector number is used to differentiate the formats. The
  267. other two are used by CP/M 86 on an IBM PC and also by CCP/M 86 and
  268. DOS Plus, that was shipped with the Amstrad PCs. Dos Plus is
  269. compatible to CP/M 86 and PC-Dos and good for copying between CP/M and
  270. MsDos.
  271. An additional advantage of this format is, that discs can be created
  272. using Dos FORMAT.COM (FORMAT /8). But before that the sector fill byte
  273. in the drive parameter table of Dos must be set to 0e5h. If you find
  274. this to be too awkward you can use the program CPMFRM.EXE. It installs
  275. the necessary parameters and calls FORMAT.COM. If there is the Msdos
  276. default fill byte 0f6h in the CP/M directory CP/M sees an entry and
  277. thinks the disk is full.
  278.  
  279. ZSIM recognizes the format of the inserted disk at every warm boot if
  280. it is one of the five specified above. So every time you insert
  281. another disk you should press Control-C. But this is recommended
  282. anyway as Bdos aborts with "Bdos Error on A:RO" on any write attempt
  283. to a disk that was not logged in with Control-C.
  284. Note: you can suppress this auto-login by starting ZSIM with option /N
  285. (no auto-login). This may be useful as auto-login takes some time to
  286. start the disc drive. It is possible to manually edit the disc
  287. parameters from the Control Break Menu and adapt them to a given
  288. manufacturer dependent format. Also you can start ZSIM with parameter
  289. /f <diskparfile>.
  290. <diskparfile> can be created by Control-Break menu Save Parameters.
  291. Note that single density formats are not supported by the IBM Bios and
  292. 8 Inch disks don't like being pressed into a 5 1/4 Inch drive.
  293.  
  294. IV SCREEN DRIVER
  295. ================
  296.  
  297. The screen driver supports the CP/M Plus screen control codes.
  298. Additionally a subset of control codes of the Amstrad CPC is
  299. supported. For a description of the control codes see appendix 1.
  300. Contrary to Digital Research's recommendation Bit 7 of the input ascii
  301. code is not zeroed.
  302. If you enter an international character (e.g. a German umlaut) it is
  303. translated from IBM coding into CP/M coding (e.g. ä => { ). To display
  304. an international character set it should be switched on by ESC 2 2.
  305.  
  306.  
  307. V PRINTER:
  308. ==========
  309.  
  310. Characters are sent to printer lpt0. ZSIM waits until the printer has
  311. taken the character correctly. This can result in an infinite loop if
  312. the printer is switched off. To prevent this there is a test for
  313. Control-C. If it is pressed there is a warm boot. This is only
  314. recommended in case of emergency because this way the calling program
  315. is aborted too, of course.
  316.  
  317.  
  318. PUNCHER:
  319. ========
  320.  
  321. Digital Research specified function 6 for serving a puncher.
  322. As punchers haven't great importance anymore I used functions 6 and 7
  323. to transfer data to MsDos and vice versa. Characters are APPENDED to
  324. the Msdos file PUNCH.CPM. It is created if non existent. Characters
  325. are buffered until buffer full. The buffer is also written out if you
  326. hit Control-Break.
  327. You can also use function 6 to access the COM ports of you PC. See
  328. function 6 within technical description below.
  329.  
  330.  
  331. NOTE: Since ZSIM version 2.0 there is a utility called dosftp
  332.       for file-transfer between CP/M and dos.
  333.       This is the recommended way to transfer data to dos.
  334.       See appendix 6
  335.  
  336. Calling function 6:
  337.  
  338. It's easiest done with PIP.
  339.  
  340.   PIP PUN:=ANYFILE.EXT
  341.  
  342.  
  343.  
  344. VI ENDING THE EMULATION:
  345. ========================
  346.  
  347. The Z80 emulation can be terminated by pressing Control-Break where
  348. after a menu pops up. You will also see this menu if the emulator
  349. encounters the Z80 code HALT.
  350.  
  351.  
  352.  
  353. In rare cases a fatal error can occur: Dos loads ZSIM and its disc
  354. buffers to an unlucky address, that a so called DMA Boundary Crossing
  355. is happening. Then the emulation is instantly aborted. The emulator
  356. must be loaded to another address. Simply start a new shell by
  357. entering COMMAND and afterwards ZSIM again.
  358.  
  359.  
  360.  
  361. VII CONTROL BREAK MENU
  362. =======================
  363.  
  364. After pressing Control Break the following menu pops up:
  365.  
  366.  
  367.  
  368.                     ┌─────────────────┐
  369.                     │Continue         │
  370.                     │Save Ramdisc/Quit│
  371.                     │Quit             │
  372.                     │Save Ramdisc     │
  373.                     │Delete Punch File│
  374.                     │Init Reader      │
  375.                     │OS Shell         │
  376.                     │Disk Parameters  │
  377.                     │Save Parameters  │
  378.                     │Load Parameters  │
  379.                     │Login Disc       │
  380.                     │Swap Drives      │
  381.                     │Reset Screen     │
  382.                     │Warm Boot        │
  383.                     │About            │
  384.                     └─────────────────┘
  385.  
  386.  
  387.  
  388.  
  389. Use the cursor keys to select the action you wish. Esc finishes the
  390. menu, same as Continue.
  391.  
  392. Continue           continues the CP/M emulation
  393.  
  394. Save Ramdisc/Quit  saves the ramdisc to the disc ZSIM was started
  395.                    from and ends ZSIM.
  396.  
  397.  
  398. Quit               ends ZSIM without saving the ramdisc.
  399.  
  400. Save Ramdisk       saves the ram disk and continues the emulation.
  401.                    This makes sense if you wish to save different
  402.                    contents of the ram disk. Important: after that
  403.                    you have to start an OS Shell and rename the
  404.                    saved ram disk (RAMDISC.CPM) else it would be
  405.                    overwritten if you save the ram disk next time.
  406.  
  407.  
  408. Delete Punch File  deletes the MsDos file, the punch data are written
  409.                    into.
  410.  
  411. OS Shell           starts an Dos Shell, but you only get 128K memory
  412.                    for it. But that is enough for REN and COPY. ZSIM
  413.                    first looks in the environment variable COMSPEC for
  414.                    the location of COMMAND.COM. If COMSPEC is not set
  415.                    ZSIM tries to start \COMMAND.COM on the drive ZSIM
  416.                    was started.
  417.  
  418.  
  419. Disk Parameters    is used for editing the CP/M disc parameters
  420.                    (described below).
  421.  
  422. Save Parameters    saves the disc parameters to a file. Enter
  423.                    for that a filename with extension. The parameters
  424.                    are saved as hexbytes in the same order they appear
  425.                    in the edit box. Before the parameters the bytes
  426.                    'JW' are saved as signature.
  427.                    The auto-login flag and physical drive are not
  428.                    saved.
  429.  
  430. Load Parameters    loads the disc parameters from a file that was
  431.                    saved with Save Parameters. Enter for loading the
  432.                    filename with extension. After loading the
  433.                    auto-login flag is cleared and a warm boot is made.
  434.  
  435. Login              Disc useful if you inserted a disc with an another
  436.                    format. If this is at a dos prompt entering ^C
  437.                    afterwards is a good idea.
  438.  
  439. Swap Drives        Drive A: becomes B: and vice versa
  440.                    This is useful if you want submit to write its
  441.                    temporary data onto the ram disk.
  442.                    If you additionally set the autologinflag to 0
  443.                    you can work really fast on the ram disk.
  444.  
  445. Reset Screen       has the same effect as output of the control
  446.                    sequence ESC @
  447.  
  448.  
  449. Warm Boot          has the same effect as pressing Control-C under
  450.                    CP/M, but it also works if a program runs.
  451.                    The IOBYTE is reset to the default value.
  452.  
  453.  
  454. About              tells the program name and Author.
  455.  
  456.  
  457.  
  458. VIII DISC PARAMETERS
  459. ====================
  460.  
  461. If you select Disk Parameters in the Control-Break menu you can edit
  462. the parameters in an edit panel.
  463. During input only valid hex digits are accepted, other characters are
  464. ignored. ESC ends editing, changes until the line before the cursor
  465. are valid. Use BACKSPACE to delete characters in the cursor line. An
  466. input line must be ended with ENTER. If you press ENTER without having
  467. entered a new value the old value is kept (like in the following
  468. example in the lines where there is no value behind the colon).
  469.  
  470.  
  471. Example:
  472.  
  473.  
  474. jgw 59K TPA cp/m 80 bios ver 1.1 --  10/12/91  (C) 1990 by Jürgen G. Weber
  475.  
  476. BDOS: COPYRIGHT (C) 1979, DIGITAL RESEARCH
  477.  
  478. Unknown disc format. Insert new disc and press any key
  479.      ┌──────────────────┐
  480.      │SPT: 0024  : 28   │
  481.      │BSH:   03  :      │
  482.      │BLM:   07  :      │
  483.      │EXM:   00  :      │
  484.      │DSM: 00A8  : B8   │
  485.      │DRM: 003F  :      │
  486.      │AL0:   C0  :      │
  487.      │AL1:   00  :      │
  488.      │CKS: 0010  : 40   │
  489.      │OFF :0002  : 3    │
  490.      │                  │
  491.      │DRV:   00  :      │
  492.      │PTR:   28  :      │
  493.      │PST:   09  : 5    │
  494.      │BPS:   02  : 3    │
  495.      │FSC:   01  :      │
  496.      │LOG:   FF  : 0    │
  497.      └──────────────────┘
  498.  
  499.  
  500. Here I had inserted an alien disc (Osborn DD). After ZSIM had
  501. complained about an unknown disc format I had pressed Control-Break.
  502. Afterwards I entered the correct values.
  503.  
  504. The parameters in the upper half are standard CP/M parameters.
  505.  
  506. How to get these parameters ?
  507.  
  508. One way is to get those parameters from other sources. The shareware
  509. program 22DISC from Sydex contains a large list of disc formats.
  510.  
  511. If you have to explore them yourself, you must run your CP/M computer.
  512. One way to get the parameters is with STAT.
  513. I have written behind the output of STAT the name of the value in the
  514. disc parameter menu.
  515.  
  516. B>stat a:dsk:
  517.  
  518.     A: Drive Characteristics
  519.  1224: 128 Byte Record Capacity      (-> record size = 128 Bytes)
  520.   153: Kilobyte Drive  Capacity      (DSM+1)
  521.    64: 32  Byte Directory Entries    (DRM)
  522.    64: Checked  Directory Entries    (CKS)
  523.   128: Records/ Extent
  524.     8: Records/ Block                (-> Blocksize = 128*8 )
  525.    32: Sectors/ Track                (SPT)
  526.     1: Reserved Tracks               (OFF)
  527.  
  528.  
  529. Now the entries BSH, BLM, EXM, AL0 and AL1 are still missing.
  530.  
  531. BSH (block shift) is log2(Blocksize/128)
  532. BLM (block mask)  is Blocksize/128-1
  533. EXM (extent mask) is (Blocksize/1024)-1
  534. AL0, AL1 is a 16 bit vector, that describes where the directory blocks
  535. are. If we have 64 directory entries (as above) we need 64*32 bytes
  536. = 2048 bytes, so we need 2 blocks for the directory and got
  537. AL00 = 11000000b
  538. AL10 = 00000000b
  539.  
  540. AN EASIER WAY
  541. =============
  542.  
  543. Now that we have learned to calculate the disc parameters I show a way
  544. to simply copy them. Run on your old CP/M machine DDT (do not enter
  545. the ; and the rest of the line).
  546.  
  547. A>b:ddt
  548. DDT VERS 2.2
  549. -l0
  550.   0000  JMP  FA03         ; to get the bios entry addresses
  551.   0003  NOP               ; the high byte is FA
  552.                           ; (this may be at another place in your machine)
  553.  
  554. -a100                     ; now enter some 8080 code:
  555. 0100  mvi c,0             ; take drive 0
  556. 0102  call 0fa1b          ; take the high byte from above + 1B
  557. 0105
  558. -g100,105                 ; execute it
  559. *0105
  560. -x
  561. C0Z0M0E0I0 A=00 B=0000 D=0000 H=FEB0 S=0100 P=0105 LXI  B,4F43
  562.  
  563. ; the address of the bios parameter block is in HL (here FEB0).
  564.  
  565. -dfeb0
  566. FEB0 00 00 11 00 00 00 00 00 EE FE D0 FE 6E FF 7E FF ............n.~.
  567.                                    ^^ ^^
  568. ...
  569.  
  570. ; We only need the entries at offset 0A + 0B. This is the address of
  571. ; the disc parameter block we need.
  572.  
  573. ; and here we got them!
  574. -dfed0
  575. FED0 20 00 03 07 00 98 00 3F 00 C0 00 10 00 01 00 20  ......?.......
  576.       SPT  BSH   EXM       DRM     AL1       off
  577.               BLM    DSM        AL0    CKS      ^ the end
  578.  
  579.  
  580. Note that this way you can't get the parameters PTR to FSC. You have
  581. to look into the manual of your CP/M computer, get them from some
  582. other source (e.g. 22DISC, see below) or try them out.
  583.  
  584. Now we copy those values into the disc parameter menu and get:
  585.  
  586.      ┌──────────────────┐
  587.      │SPT: 0020  :      │
  588.      │BSH:   03         │
  589.      │BLM:   07         │
  590.      │EXM:   00         │
  591.      │DSM: 0098         │
  592.      │DRM: 003F         │
  593.      │AL0:   C0         │
  594.      │AL1:   00         │
  595.      │CKS: 0010         │
  596.      │OFF :0001         │
  597.      │                  │
  598.      │DRV:   01         │
  599.      │PTR:   28         │
  600.      │PST:   08         │
  601.      │BPS:   02         │
  602.      │FSC:   01         │
  603.      │LOG:   FF         │
  604.      └──────────────────┘
  605.  
  606.  
  607. The parameters DRV to LOG are an extension by me and mean the
  608. following:
  609.  
  610. DRV: physical number of the drive with the CP/M disc (0 or 1);
  611.      but this is always drive A: within CP/M
  612. PTR: physical track number, 40 with a 360K drive, else (with 720K,
  613.      1.2 MB or 1.4 MB) up to 80 tracks
  614. PST: number of physical sectors per track, 9 with 360K drives
  615. BPS: physical sector length; BPS=log2(SecLen in bytes )-7; this value
  616.      is required by the disc controller, often 2 for 512 bytes sectors
  617. FSC: physical number of first sector of a track, usually 1
  618. LOG: FF=autologin, 0=no autologin
  619.  
  620. If you change the parameters you should set LOG to 0, else the next
  621. autologin would change the parameters again.
  622.  
  623. To get standard parameters, set LOG to FF, insert a disc with normal
  624. format and press Control-C. But a secure format adaptation only is
  625. possible with single sided formats. Some double sided formats address
  626. the second side as extension of the tracks of the first side (with the
  627. effect of more sectors per track), others double the track count.
  628. ZSIM's bios uses the method of CP/M 86 double sided (double sector
  629. count and track translation).
  630.  
  631.  
  632. IX EMULATION OF THE Z80
  633. =======================
  634.  
  635. The emulated machine behaves almost completely like a Z80 CP/M
  636. machine.
  637. All emulated Z80 instructions that change or use flags where tested
  638. (especially how they influence flags). All defined flags are
  639. influenced exactly as on an original Z80 chip. I tested this by
  640. looping the register pair HL from 0 to FFFFh and copying it with PUSH
  641. HL - POP AF to AF, executing the instruction to test and adding the
  642. resulting AF register pair to a check sum. I improved the emulation
  643. until all flag influencing instructions resulted the same checksum on
  644. the Z80 and on the emulation. The Z80 test program is in appendix 4.
  645.  
  646. The Z80 flags that are not defined by Zilog and show more or less
  647. random behaviour are not defined within ZSIM either. But different not
  648. defined flag stati may result.
  649. ZSIM supports non documented Z80 instructions, so called illegal
  650. opcodes (see Appendix 3 for a description).
  651.  
  652.  
  653. All CP/M programs I tested run with ZSIM as on a CP/M machine, even
  654. the floating point package of the small-C compiler that uses
  655. undocumented Z80 instructions.
  656.  
  657. A preeminent difference between emulation and original Z80 chip is
  658. the execution time. There is no proportional relation between the tact
  659. cycles an operation takes on the emulation and the cycles needed on a
  660. Z80. So you cannot realize time critical applications like cassette
  661. storing routines with ZSIM.
  662.  
  663.  
  664. A Z80 uses the R register for refreshing dynamic rams and continually
  665. increments it. Some programmers used this on a Z80 as random
  666. generator. So ZSIM loads it with "random" values derived from the
  667. system time.
  668.  
  669. Port operations do not execute port accesses, as input you get 0FFh.
  670. The flags are set and port operations with block repeat change the
  671. count registers accordingly. You can change the action of port
  672. commands in module PORTIO.
  673.  
  674.  
  675. X BENCHMARKS
  676. ============
  677.  
  678. Some Tests of the speed of the emulation (version 1.2):
  679.  
  680.  
  681. I used the following benchmarks:
  682.  
  683. 1) Compile the program TEST.C included with Ron Cains Small C
  684.    Compiler.
  685.    The executable TEST.COM is very hard to emulate as its floating
  686.    point routines use undocumented Z80 ops. Contrary to all other
  687.    emulators I know, ZSIM emulates these operations correctly and
  688.    TEST.COM works.
  689.  
  690. 2) Compiling MC.PAS (on the Turbo disc) with TURBO PASCAL 3.0 on
  691.    disc.
  692.  
  693. 3) Compiling LISTER.PAS (on the Turbo disc) with TURBO PASCAL 3.0 in
  694.    memory.
  695.  
  696. 4) Enter a short assembler loop with the debugger and execute it:
  697.  
  698.       LD B,20
  699.    L1:LD HL,0
  700.    L2:INC HL
  701.       LD A,H
  702.       OR L
  703.       JP NZ,L2
  704.       DJNZ L1
  705.  
  706. 5) let DDT dump a range of memory:
  707.  
  708.    D0,8000
  709.  
  710.  
  711. RESULTS (ZSIM 1.2 on a 16 MHz 386 SX), Z80 Tests were run on an
  712. Amstrad CPC, Z80 A, 4 MHz, 1 wait-state :
  713.  
  714. TestNr ZSIM:Z80   CPC/Z80   ZSIM
  715.  
  716.   1     0,85     3.37.00   3.04.00
  717.  
  718.   2     0,88     1.20.00   1.10.00
  719.  
  720.   3     0,99     0.03.65   0.03.63
  721.  
  722.   4     1,37     0.17.10   0.23.45
  723.  
  724.   5     0,41     4.06.00   1.40.00
  725.  
  726.  
  727.  
  728. Nr. 4 is the test that says most about emulation speed because here
  729. only calculation time without bios overhead is measured.
  730. Test Nr. 1 strains the disc drive as compiling, assembling and linking
  731. are made on disc. The huge disk buffers of ZSIM greatly speed this up.
  732. Test Nr. 4 is similar to test 1.
  733. Test Nr 3 should give a similar result as Nr. 4, but Turbo Pascal
  734. continually displays the line it compiles therefore the slow screen
  735. output of the CPC takes time.
  736.  
  737. In test Nr 5 screen output is the bottle neck, where the CPC with its
  738. text output in graphic mode has no chance against the screen output of
  739. an 80386.
  740.  
  741.  
  742. Appendix 1: Screen control sequences
  743. ====================================
  744.  
  745. Implemented screen control sequences:
  746.  
  747. CPC
  748.  
  749. Ascii        Operation
  750.  2           cursor off
  751.  3           cursor on
  752.  7           Bell
  753.  8           Cursor left
  754.  9           Cursor right
  755. 10           Cursor down
  756. 11           Cursor up
  757. 12           clear screen
  758. 13           Cursor to beginning of line
  759. 16           delete char under cursor
  760. 17           delete line to cursor
  761. 18           delete line from cursor
  762. 19           delete screen to cursor
  763. 20           delete screen from cursor
  764. 24           toggle highlight
  765. 30           cursor home
  766. 31 x y       cursor column x,line y (home = 1,1 )
  767.  
  768. CP/M Plus:
  769.  
  770. ESC @        Init Screen: CLS,HOME,highlight off, cursor on,
  771.              underline off, US char set
  772. ESC 2 x      select country character set:
  773.                 x        country:
  774.  
  775.                 0        USA
  776.                 1        France
  777.                 2        Germany
  778.                 3        Britain
  779.                 4        Denmark
  780.                 5        Sweden
  781.                 6        Italy
  782.                 7        Spain
  783.  
  784. ESC A        cursor up
  785. ESC B        cursor down
  786. ESC C        cursor right
  787. ESC D        cursor left
  788. ESC E        clear screen, cursor keeps position
  789. ESC H        cursor home
  790. ESC I        cursor up, scroll if necessary
  791. ESC J        clear screen from cursor
  792. ESC K        delete line from cursor
  793. ESC L        insert line
  794. ESC M        delete line
  795. ESC N        delete char below cursor
  796. ESC Y y x    cursor to column x,line y, Home = 32,32
  797. ESC d        delete line to cursor
  798. ESC e        cursor on
  799. ESC f        cursor off
  800. ESC j        store cursor position
  801. ESC k        get stored cursor position
  802. ESC o        delete line to cursor
  803. ESC p        highlight on
  804. ESC q        highlight off
  805. ESC r        underline on
  806. ESC s        blinking on
  807. ESC t        blinking off
  808. ESC u        underline off
  809.  
  810.  
  811.  
  812. Appendix 2: Description of the bios functions
  813. =============================================
  814.  
  815. Technical description of the implemented CP/M 80 Bios
  816.  
  817. Every Bios routine is called by executing an pseudo
  818. Z80 CALLN opcode (EDED) with biosnumber as following byte.
  819.  
  820. Description of the calls:
  821.  
  822. 0 Cold boot
  823.  
  824.   Loads Bdos from MS-Dos file CPMSYS.CPM into memory and installs bios
  825.   jp table and disk parameters in Z80 ram. Drive A: is selected,
  826.   IO-Byte is set to 81h, buffer is cleared and control passed
  827.   to bios routine warm boot.
  828.   If CPMSYS.CPM does not exist, boot tries to load Bdos from the
  829.   system tracks. ZSIM searches all reserved tracks (<OFF) for the
  830.   copyright message of Digital Research. If found the following
  831.   sectors are loaded as Bdos.
  832.   If this was successful you can create with MOVCPM a file that
  833.   contains the Bdos. This file must be transferred to the MS-Dos Start
  834.   Disk of ZSIM and be renamed to CPMSYS.CPM.
  835.  
  836. 1 Warm boot
  837.  
  838.   Copy the bdos that was loaded by function 0 into memory to its
  839.   correct position in the Z80 memory area. ZSIM takes the correct
  840.   address specified by MOVCPM. Afterwards it is tested if the disc has
  841.   a known format. If known the right disc parameters are created. Now
  842.   the Z80 simulator is started and CP/M CCP called.
  843.  
  844. 2 Consol Status
  845.  
  846.   return offh in A if there is a char ready on keyboard.
  847.  
  848. Functions 3 to 7 have behaviour corresponding to the value of
  849. the iobyte.
  850.  
  851.  
  852.  
  853. 3 Consol Input CON:
  854.   return ascii code from CON: in A.
  855.  
  856. assignable devices     set to
  857.  
  858.       TTY:             crtin
  859.       CRT:             crtin   (default)
  860.       BAT:             reader
  861.       UC1:             crtin
  862.  
  863. crtin:
  864.   Contrary to suggested by Digital Research Bit 7 is not cleared.
  865.   If an international character (e.g. German Umlaut) is input it is
  866.   transformed from IBM code into CP/M code (e.g. ä => { ).
  867.   International character sets are only displayed if switched on with
  868.   ESC 2 x.
  869.   Extended PC keys: If in CONIO.ASM the constant WS_KEY is set to
  870.   TRUE, the cursor keys, Ins, Del, Home, End, PgUp and PgDn are
  871.   converted to wordstar control sequences (^Q... ). The following call
  872.   of conin returns ^Q and the next the corresponding Code.
  873.  
  874. 4 Consol Output CON:
  875.  
  876. assignable devices     set to
  877.  
  878.       TTY:            crtout
  879.       CRT:            crtout   (default)
  880.       BAT:            punch
  881.       UC1:            crtout
  882.  
  883. crtout:
  884.   Displays char in C on screen. Control sequences are evaluated as
  885.   described in appendix 1.
  886.  
  887. 5 List Character LPT:
  888.  
  889. assignable devices     set to
  890.  
  891.       TTY:            punch
  892.       CRT:            crtout
  893.       LPT:            lpt0list (default)
  894.       UL1:            lpt1list
  895.  
  896. lptXlist:
  897.   Copies char in C to printer lpt X. Waits until the printer has
  898.   accepted the char correctly. This would result in an infinite loop
  899.   is there is no printer. Therefore the function tests for Control-C.
  900.   If pressed, a jump to Z80 address 0 follows. There is normally a
  901.   jump to warm boot.
  902.  
  903. 6 Punch Character PUN:
  904.  
  905. assignable devices     set to
  906.  
  907.        TTY:           filepunch (default)
  908.        PTP:           filepunch
  909.        UP1:           com0list
  910.        UP2:           com1list
  911.  
  912. comXlist:  put character to comX
  913.            This functions should be programmed better
  914.            as I only implemented stub functions.
  915. filepunch:
  916.   Digital Research provided this function for serving a puncher.
  917.   As punchers/readers aren't of overwhelming importance anymore I used
  918.   this function to transfer data to MS-Dos. Characters transferred to
  919.   this function are appended to the MS-Dos file PUNCH.CPM. If it does
  920.   not exist it is created.
  921.   The characters are buffered and written out, if buffer is full. This
  922.   buffer is written out too if the Control-Break menu pops up.
  923.  
  924.  
  925. 7 Read Character RDR:
  926.  
  927. assignable devices     set to
  928.  
  929.        TTY:            filereader (default)
  930.        PTR:            filereader
  931.        UR1:            com0read
  932.        UR2:            com1read
  933.  
  934. comXread:  get character from comX
  935.            This functions should be programmed better
  936.            as I only implemented stub functions.
  937. filereader:
  938.   Reads characters from MS-Dos file READER.CPM. This only works with
  939.   files that don't contain CPM_EOF (26). The PIP option [o] does not
  940.   help as there is no way to signal PIP the actual end of file and PIP
  941.   gets stuck in an infinite loop.
  942.   If READER.CPM does not exist or is read to end, CPM_EOF (26) is
  943.   returned.
  944.   To differentiate EOF from a 26 byte in a binary file this function
  945.   additionally returns at the end of READER.CPM -1 (0ffffh) in HL else
  946.   H=0, L=char. This is not provided by DR and is not interpreted by
  947.   standard programs especially not by PIP!
  948.   The following assembler lines return the character read in L or -1
  949.   in HL:
  950.  
  951.   LD HL,(1)
  952.   LD DE,6*3  ; BIOS READER, RETURN IN HL OR -1 IF ERROR
  953.   ADD HL,DE
  954.   JP (HL)    ;
  955.  
  956.   After transferring a file you should execute Init Reader in Control
  957.   Break menu.
  958.   Example:
  959.  
  960.           PIP B:ANYFILE.TXT=RDR:
  961.  
  962.  
  963.  
  964. 8 Home
  965.  
  966.   Should return the read/write heads of the drive to track 0, but is
  967.   not executed for speed reasons. Only set track with parameter 0 is
  968.   called.
  969.  
  970. 9 Select Disk
  971.  
  972.   Selects the Drive given over in register C and returns if the drive
  973.   exists in register HL a pointer of its DPH else 0. There are only
  974.   the physical drive A: and the ram disk b:
  975.  
  976. 10 Set Track
  977.  
  978.    In register C.
  979.  
  980. 11 Set Sector
  981.  
  982.    In register C.
  983.  
  984. 12 Set DMA
  985.  
  986.    Register BC contains Data transfer buffer.
  987.  
  988. 13 Read Sector
  989.  
  990.    Reads the sector selected by functions 9,10,10. Reading from
  991.    ram disk or hard disk is quite easy. Reading from disk is more
  992.    difficult as for reasons of speed the directory track and one
  993.    data track are buffered in ram. First must be decided if the
  994.    sector is already in buffer. If not the track first must be
  995.    read from disk. Afterwards the correct address in buffer must
  996.    be calculated.
  997.  
  998. 14 Write Sector
  999.  
  1000.    Writes the sector selected by functions 9,10,10. Writing to
  1001.    ram disk is quite easy. Writing to disk is more difficult as for
  1002.    reasons of speed the directory track and one data track are
  1003.    buffered in ram. If the sector is in the directory track the sector
  1004.    is written out immediately for security reasons. Otherwise the
  1005.    sector is buffered in ram. It is save enough only to write out the
  1006.    directory track immediately as after changing a file the directory
  1007.    is updated which results in writing out the directory track and the
  1008.    data track.
  1009.  
  1010. 15 ListStatus
  1011.  
  1012.    Signals if the printer is ready to receive (A=1 = ready).
  1013.  
  1014. 16 Sector Translation
  1015.  
  1016.    Some CP/M systems make a logical sector translation for the skew
  1017.    factor. This is done by function 16.
  1018.  
  1019.  
  1020. 26 read/set time and date
  1021.  
  1022.    This function is a supplement not provided in the CP/M 80 Bios. It
  1023.    works like in CP/M Plus. It is also supported by the Public Domain
  1024.    Bdos Z80DOS. To use it in the source of Z80DOS the entry address of
  1025.    time must be set:
  1026.  
  1027.    BIOStim equ     BIOS+4EH
  1028.  
  1029.    Writing of date and time (c=0ffh) is not supported in order not to
  1030.    change the real time clock of the PC.
  1031.  
  1032.    A call with C=0 reads the time and returns a pointer in HL to the
  1033.    following structure:
  1034.  
  1035.    dw @date  ; full days since Jan, 1st, 1978
  1036.    db @hour  ; hours in BCD format
  1037.    db @min   ; minutes in BCD format
  1038.    db @sec   ; seconds in BCD format
  1039.  
  1040. 30 user
  1041.  
  1042.    CP/M 3.0 reserves function 30 for user subroutines. The ZSIM bios
  1043.    offers some sub-functions of function 30 to copy data to and from
  1044.    msdos. As this is incompatible to all other bios implementations it
  1045.    is not described here. Look at the bios sources if you are
  1046.    interested.
  1047.  
  1048.  
  1049.  
  1050. Appendix 3: undocumented Z80 Op-Codes
  1051. =====================================
  1052.  
  1053. Description of undocumented Z80 Op-Codes (as far as I know them)
  1054.  
  1055. The IX,IY registers can be used as 8 bit registers XL,XH,YL,YH
  1056. analogous to H and L. They are coded as the corresponding H/L
  1057. operations with 0ddh/0fdh prefix for IX/IY.
  1058.  
  1059. e.g.:   8D  ADC A,L     ->     FD 8D  ADC A,LY
  1060.  
  1061.  
  1062. This works with all 8080 (that means no Z80 commands with CB or ED
  1063. prefix) commands that use the 8 bit register H or L with the
  1064. restriction, that only one register of the set { H,L,HX,LX,HY,LY } may
  1065. appear in the command. E.g.  LD L,LX does not work.
  1066.  
  1067. TSTI (C) (Code ED 70) sets the flags corresponding to the value of
  1068.          port (C).
  1069.  
  1070. SLIA s   (shift left inverted arithmetic) works like SLA but
  1071.          bit 0 := 1
  1072.          It is coded as  CB 00110rrr  (rrr coded as in SLA).
  1073.  
  1074.  
  1075. The following are NOT implemented in ZSIM, as they are too
  1076. eccentric.
  1077.  
  1078. DD CB ofs XX with XX=10bbbrrr,11bbbrrr (rrr=110 for (HL) is the
  1079. documented BIT|SET b,(IX+d) ) works as
  1080. CB ofs XX ( RES|SET (IX+d)) but afterwards rrr:=(IY+d). )
  1081.  
  1082. XX=01bbbrrr for BIT works as the documented version.
  1083.  
  1084. DD CB ofs XX with XX=00cccrrr works as CB ofs XX with a CMD of
  1085. {RLCA,...,SRL, and SLIA}, but afterwards rrr:=(IX+d).
  1086. With rrr=110 you get the documented CMD (IX+d)
  1087. e.g. DD CB ofs 00101110 = SRA (IX+offs).
  1088.  
  1089. Appendix 4: A test for the emulation
  1090. ====================================
  1091.  
  1092. I ran the following code on the emulation and on a Z80 chip.
  1093. Both bring the same results.
  1094.  
  1095. TSTZ80.MAC:
  1096.  
  1097.  
  1098. .z80
  1099. ;     DE' := CHECKSUM OVER F
  1100. ;     HL' := CHECKSUM OVER A
  1101.  
  1102.  
  1103.           JP MAIN
  1104. TSTZ80:
  1105.           REPT 16
  1106.             NOP    ; INSERT  CODE HERE
  1107.           ENDM
  1108.           RET
  1109.  
  1110. MAIN:
  1111.           LD HL,0
  1112.           LD DE,0
  1113.           EXX
  1114.           LD BC,0 ; LOOP OVER 0FFFF COMBINATIONS OF A AND F
  1115. L1:       PUSH BC
  1116.           LD A,C
  1117.           AND 11010111B ; USE ONLY DOCUMENTED FLAG BITS
  1118.           REPT 6*2
  1119.             NOP        ; SET/MASK FLAGS HERE IF NECESSARY
  1120.           ENDM
  1121.           LD C,A
  1122.           PUSH BC
  1123.           POP  AF ; A:=B; F:=C
  1124.           LD   H,B
  1125.           LD   L,C
  1126.           CALL TSTZ80
  1127.           CALL CHECK
  1128.           POP BC
  1129.           INC BC
  1130.           LD  A,B
  1131.           OR  C
  1132.           JP NZ,L1
  1133.           RST 30H  ; ZSID END
  1134.  
  1135. CHECK:
  1136. ; BUILDS SIMPLE CHECKSUM OVER A AND F
  1137.           EXX
  1138.           PUSH AF
  1139.           LD   B,A
  1140.           LD   C,A
  1141.  
  1142.           LD   A,H
  1143.           XOR  B
  1144.           LD   H,A
  1145.           LD   A,L
  1146.           XOR  C
  1147.           LD   L,A
  1148.           ADD  HL,HL
  1149.  
  1150.           POP  BC
  1151.           LD   A,C
  1152.           AND 11010111B ; MASK UNUSED FLAG BITS
  1153.           LD   C,A
  1154.           LD   B,A ; B=C=F
  1155.  
  1156.           EX   DE,HL
  1157.  
  1158.           LD   A,H
  1159.           XOR  B
  1160.           LD   H,A
  1161.           LD   A,L
  1162.           XOR  C
  1163.           LD   L,A
  1164.           ADD  HL,HL
  1165.  
  1166.           EX   DE,HL
  1167.           EXX
  1168.           RET
  1169. END
  1170.  
  1171. END OF TSTZ80.MAC
  1172.  
  1173. Appendix 5: How to use interrupts
  1174. =================================
  1175.  
  1176. NOTE: The emulated machine supports the Z80 interrupt system.
  1177. To enable the interrupt system, switch on the interrupt option in
  1178. the cpm-bios source. By default the interrupt option is disabled.
  1179. CP/M does NOT use interrupts.
  1180. The following code was entered with a debugger and displayed as result
  1181. the @s. 
  1182. This code does not work with the 8080 version of the
  1183. emulation and not together with programs that use the alternate Z80
  1184. register set.
  1185. The comments behind ; may not be entered within the
  1186. debugger.
  1187.  
  1188. #a100
  1189. 0100  im 1         ; do a RST 38H at interrupts
  1190. 0102  ei           ; enable interrupts
  1191. 0103  jp 103       ; do an infinite loop in order not to enter bios
  1192. 0106  .            ; as interrupts will not occur within bios
  1193. #a38               ; the interrupt service routine starts at 38h
  1194. 0038  ex af,af'    ; cp/m offers not enough stack space to save
  1195. 0039  exx          ; registers, so swap to the alternate register set
  1196. 003A  ld c,40      ; '@'
  1197. 003C  call 0f90c   ; address of console output within ZSIM
  1198. 003F  exx          ; (don't use BDOS, it's not reentrant)
  1199. 0040  ex af,af'    ; and restore registers
  1200. 0041  ei           ; an interrupt acknowledge disables interrupts
  1201. 0042  ret
  1202. 0043  .
  1203. #g100              ; start program at 100h (it goes into a loop)
  1204. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1205. @@@@@@@@@@@@@@@@@@@@@@@@
  1206.  
  1207.  
  1208. Appendix 6: The DOSFTP utility
  1209.  
  1210. Since ZSIM version 1.4 there is a utility called dosftp
  1211. for file transfer between CP/M and dos.
  1212. It makes use of bios function 30 to transfer data to dos.
  1213. Simply enter dosftp to start it. Dosftp prompts with dosftp>
  1214. You cannot abbreviate the commands.
  1215.  
  1216. B>dosftp
  1217. Enter help for a command list.
  1218. WARNING: DO NOT ACCESS your physical CP/M drive (MSDOS drive B:)
  1219.         with the exec command.
  1220. dosftp> help
  1221. help
  1222. dir     ldir    mput    mget
  1223. get     put     prompt  exec
  1224. lera    quit
  1225. dosftp>
  1226.  
  1227. In the following wildarg stands for an argument with wild-cards,
  1228. eg. *.C
  1229.  
  1230. dir wildarg     displays the files of the current dos directory
  1231.  
  1232. ldir wildarg    displays the files of the current cp/m disc
  1233.  
  1234. mput wildarg    copies files from cp/m to dos
  1235.  
  1236. mget wildarg    copies files from dos to cp/m
  1237.  
  1238. put arg         copies one file from cp/m to dos, you may specify a
  1239.                 dos name: put cpm.c dos.c
  1240.  
  1241. get arg         analogous to put
  1242.  
  1243. prompt          toggles a flag. If flag is set you are prompted before
  1244.                 each multiple action (mput,mget,lera)
  1245.  
  1246. exec arg        executes dos command arg
  1247.                 eg: exec xcopy dos.c dos1.c
  1248.  
  1249. lera wildarg    deletes cp/m files
  1250.  
  1251. quit            or press ctrl-c
  1252.  
  1253.  
  1254. Appendix 7: An example for IOBYTE usage
  1255.  
  1256. Display the old assignment from logical devices to physical devices:
  1257.  
  1258. A>stat dev:
  1259. CON: is CRT:
  1260. RDR: is TTY:
  1261. PUN: is TTY:
  1262. LST: is LPT:
  1263.  
  1264. Assign CON: to bat, that is read from RDR: and write to PUN:
  1265. ZSIM default for RDR: is read from msdos file READER.CPM and for
  1266. PUN: write to msdos file PUNCH.CPM
  1267.  
  1268.  
  1269.  
  1270. READER.CPM should contain some commands, e.g. DIR
  1271. and at the end: stat CON:=CRT: to reset it to keyboard/screen.
  1272.  
  1273. for example:
  1274.  
  1275. stat DSK:
  1276. stat con:=crt:
  1277.  
  1278. Now delete PUNCH.CPM (ctrl-break menu Delete Punch File)
  1279. and enter:
  1280.  
  1281. A>stat con:=bat:
  1282.  
  1283. [now input is read from READER.CPM until the last stat command]
  1284.  
  1285. A>
  1286.  
  1287. [PUNCH.CPM contains now: ]
  1288.  
  1289.  
  1290. A>stat dsk:
  1291.  
  1292.     A: Drive Characteristics
  1293.  1480: 128 Byte Record Capacity
  1294.   185: Kilobyte Drive  Capacity
  1295.    64: 32  Byte Directory Entries
  1296.    64: Checked  Directory Entries
  1297.   128: Records/ Extent
  1298.     8: Records/ Block
  1299.    40: Sectors/ Track
  1300.     3: Reserved Tracks
  1301.  
  1302. A>
  1303. A>stat con:=crt:
  1304.  
  1305.  
  1306. End of ZSIM.DOC
  1307.